<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: yuan
  Date: 2022/11/21
  Time: 19:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>统计在线人数</title>
</head>
<body>
<div align="center">
    <c:choose>
        <c:when test="${sessionScope.loginUser != null}">
            欢迎【${sessionScope.loginUser}】登录
            <br>
        </c:when>
        <c:otherwise>
            请先登录，5秒后将自动跳转,点击<a href="login.jsp">此处</a>立即跳转
            <meta http-equiv="refresh" content="5;url='login.jsp'">
        </c:otherwise>
    </c:choose>
    <h1>当前网站在线人数统计</h1>

    目前在线人数[${applicationScope.userList.size()}]人

    <table align="center" border="">

        <tr>
            <td>用户名</td>
        </tr>

        <c:forEach var="user" items="${applicationScope.userList}" varStatus="status">
            <tr>
                <td>${user}</td>
            </tr>
        </c:forEach>
        <br>
        <a href="javascript:void(0)" onclick="window.history.back()">返回</a>

    </table>
</div>


</body>
</html>
